<?php
/**
 * 订阅号管理
 * Created by PhpStorm.
 * User: zhang
 * Date: 2017/5/18
 * Time: 15:00
 */
class subscriptionSort extends AdminBase{

    protected $do;

    function __construct(){
        parent::__construct();
        $this->do = 'getSubscriptionList';
        $this->{$this->op}();
    }

    function indexAction(){
        include_once template("admin_v2/subscriptionSort");
        exit();
    }


    function listAction(){
        $this->req['start'] = isset($this->req['page']) ? (intval($this->req['page'])-1)*20 : 0;
        $this->fetchData(array_merge([
            'do'     => $this->do,
            'format' => 'json',
            'operate' => 'getSubscriptionList',
        ], $this->req));
    }

    function addAction(){
        $this->fetchData(array_merge([
            'do'     => 'setSubscriptionUids',
            'format' => 'json',
            'operate' => 'setSubscriptionUids',
        ], $this->req));
    }

    function deleteAction(){
        $this->fetchData([
            'do'     => 'delSubscriptionUids',
            'format' => 'json',
            'operate' => 'delSubscriptionUids',
            'id' => $this->req['id']
        ]);
    }

}

new subscriptionSort;